<template>
  <div class="wrap">
    <pro-table
      ref="proTableInst"
      tableTitle="日志管理列表"
      :columns="columns"
      :query="query"
      :request="fetchLogPage"
      auto-height
      noTotal
    />
  </div>
</template>

<script lang="ts" setup name="Log">
  import { ProTableInst } from '@/components/pro-table/type'
  import { useLogApi, useLogProTable } from './hooks'
  import dayjs from 'dayjs'

  const proTableInst = ref<ProTableInst | null>(null)

  const getDate = () => {
    const endDate = dayjs().format('YYYY-MM-DD')
    const startDate = dayjs().subtract(1, 'month').format('YYYY-MM-DD')
    return {
      startDate,
      endDate
    }
  }

  const { fetchLogPage } = useLogApi({ getDate })
  const { columns, query } = useLogProTable({ getDate })
</script>

<style lang="less" scoped></style>
